<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html lang="en">

<head>
  <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
  <title>LCOV - iris.info - /usr/include/c++/4.3/bits/deque.tcc</title>
  <link rel="stylesheet" type="text/css" href="../../../../../gcov.css">
</head>

<body>

  <table width="100%" border=0 cellspacing=0 cellpadding=0>
    <tr><td class="title">LTP GCOV extension - code coverage report</td></tr>
    <tr><td class="ruler"><img src="../../../../../glass.png" width=3 height=3 alt=""></td></tr>

    <tr>
      <td width="100%">
        <table cellpadding=1 border=0 width="100%">
        <tr>
          <td class="headerItem" width="20%">Current&nbsp;view:</td>
          <td class="headerValue" width="80%" colspan=4><a href="../../../../../index.html">directory</a> - <a href="index.html">usr/include/c++/4.3/bits</a> - deque.tcc</td>
        </tr>
        <tr>
          <td class="headerItem" width="20%">Test:</td>
          <td class="headerValue" width="80%" colspan=4>iris.info</td>
        </tr>
        <tr>
          <td class="headerItem" width="20%">Date:</td>
          <td class="headerValue" width="20%">2010-05-24</td>
          <td width="20%"></td>
          <td class="headerItem" width="20%">Instrumented&nbsp;lines:</td>
          <td class="headerValue" width="20%">129</td>
        </tr>
        <tr>
          <td class="headerItem" width="20%">Code&nbsp;covered:</td>
          <td class="headerValue" width="20%">18.6 %</td>
          <td width="20%"></td>
          <td class="headerItem" width="20%">Executed&nbsp;lines:</td>
          <td class="headerValue" width="20%">24</td>
        </tr>
        </table>
      </td>
    </tr>
    <tr><td class="ruler"><img src="../../../../../glass.png" width=3 height=3 alt=""></td></tr>
  </table>

  <table cellpadding=0 cellspacing=0 border=0>
    <tr>
      <td><br></td>
    </tr>
    <tr>
      <td><pre class="source">
<span class="lineNum">       1 </span>                : // Deque implementation (out of line) -*- C++ -*-
<span class="lineNum">       2 </span>                : 
<span class="lineNum">       3 </span>                : // Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007
<span class="lineNum">       4 </span>                : // Free Software Foundation, Inc.
<span class="lineNum">       5 </span>                : //
<span class="lineNum">       6 </span>                : // This file is part of the GNU ISO C++ Library.  This library is free
<span class="lineNum">       7 </span>                : // software; you can redistribute it and/or modify it under the
<span class="lineNum">       8 </span>                : // terms of the GNU General Public License as published by the
<span class="lineNum">       9 </span>                : // Free Software Foundation; either version 2, or (at your option)
<span class="lineNum">      10 </span>                : // any later version.
<span class="lineNum">      11 </span>                : 
<span class="lineNum">      12 </span>                : // This library is distributed in the hope that it will be useful,
<span class="lineNum">      13 </span>                : // but WITHOUT ANY WARRANTY; without even the implied warranty of
<span class="lineNum">      14 </span>                : // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
<span class="lineNum">      15 </span>                : // GNU General Public License for more details.
<span class="lineNum">      16 </span>                : 
<span class="lineNum">      17 </span>                : // You should have received a copy of the GNU General Public License along
<span class="lineNum">      18 </span>                : // with this library; see the file COPYING.  If not, write to the Free
<span class="lineNum">      19 </span>                : // Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
<span class="lineNum">      20 </span>                : // USA.
<span class="lineNum">      21 </span>                : 
<span class="lineNum">      22 </span>                : // As a special exception, you may use this file as part of a free software
<span class="lineNum">      23 </span>                : // library without restriction.  Specifically, if other files instantiate
<span class="lineNum">      24 </span>                : // templates or use macros or inline functions from this file, or you compile
<span class="lineNum">      25 </span>                : // this file and link it with other files to produce an executable, this
<span class="lineNum">      26 </span>                : // file does not by itself cause the resulting executable to be covered by
<span class="lineNum">      27 </span>                : // the GNU General Public License.  This exception does not however
<span class="lineNum">      28 </span>                : // invalidate any other reasons why the executable file might be covered by
<span class="lineNum">      29 </span>                : // the GNU General Public License.
<span class="lineNum">      30 </span>                : 
<span class="lineNum">      31 </span>                : /*
<span class="lineNum">      32 </span>                :  *
<span class="lineNum">      33 </span>                :  * Copyright (c) 1994
<span class="lineNum">      34 </span>                :  * Hewlett-Packard Company
<span class="lineNum">      35 </span>                :  *
<span class="lineNum">      36 </span>                :  * Permission to use, copy, modify, distribute and sell this software
<span class="lineNum">      37 </span>                :  * and its documentation for any purpose is hereby granted without fee,
<span class="lineNum">      38 </span>                :  * provided that the above copyright notice appear in all copies and
<span class="lineNum">      39 </span>                :  * that both that copyright notice and this permission notice appear
<span class="lineNum">      40 </span>                :  * in supporting documentation.  Hewlett-Packard Company makes no
<span class="lineNum">      41 </span>                :  * representations about the suitability of this software for any
<span class="lineNum">      42 </span>                :  * purpose.  It is provided &quot;as is&quot; without express or implied warranty.
<span class="lineNum">      43 </span>                :  *
<span class="lineNum">      44 </span>                :  *
<span class="lineNum">      45 </span>                :  * Copyright (c) 1997
<span class="lineNum">      46 </span>                :  * Silicon Graphics Computer Systems, Inc.
<span class="lineNum">      47 </span>                :  *
<span class="lineNum">      48 </span>                :  * Permission to use, copy, modify, distribute and sell this software
<span class="lineNum">      49 </span>                :  * and its documentation for any purpose is hereby granted without fee,
<span class="lineNum">      50 </span>                :  * provided that the above copyright notice appear in all copies and
<span class="lineNum">      51 </span>                :  * that both that copyright notice and this permission notice appear
<span class="lineNum">      52 </span>                :  * in supporting documentation.  Silicon Graphics makes no
<span class="lineNum">      53 </span>                :  * representations about the suitability of this software for any
<span class="lineNum">      54 </span>                :  * purpose.  It is provided &quot;as is&quot; without express or implied warranty.
<span class="lineNum">      55 </span>                :  */
<span class="lineNum">      56 </span>                : 
<span class="lineNum">      57 </span>                : /** @file deque.tcc
<span class="lineNum">      58 </span>                :  *  This is an internal header file, included by other library headers.
<span class="lineNum">      59 </span>                :  *  You should not attempt to use it directly.
<span class="lineNum">      60 </span>                :  */
<span class="lineNum">      61 </span>                : 
<span class="lineNum">      62 </span>                : #ifndef _DEQUE_TCC
<span class="lineNum">      63 </span>                : #define _DEQUE_TCC 1
<span class="lineNum">      64 </span>                : 
<span class="lineNum">      65 </span>                : _GLIBCXX_BEGIN_NESTED_NAMESPACE(std, _GLIBCXX_STD_D)
<span class="lineNum">      66 </span>                : 
<span class="lineNum">      67 </span>                :   template &lt;typename _Tp, typename _Alloc&gt;
<span class="lineNum">      68 </span>                :     deque&lt;_Tp, _Alloc&gt;&amp;
<span class="lineNum">      69 </span>                :     deque&lt;_Tp, _Alloc&gt;::
<span class="lineNum">      70 </span><span class="lineNoCov">              0 :     operator=(const deque&amp; __x)</span>
<span class="lineNum">      71 </span>                :     {
<span class="lineNum">      72 </span><span class="lineNoCov">              0 :       const size_type __len = size();</span>
<span class="lineNum">      73 </span><span class="lineNoCov">              0 :       if (&amp;__x != this)</span>
<span class="lineNum">      74 </span>                :         {
<span class="lineNum">      75 </span><span class="lineNoCov">              0 :           if (__len &gt;= __x.size())</span>
<span class="lineNum">      76 </span><span class="lineNoCov">              0 :             _M_erase_at_end(std::copy(__x.begin(), __x.end(),</span>
<span class="lineNum">      77 </span>                :                                       this-&gt;_M_impl._M_start));
<span class="lineNum">      78 </span>                :           else
<span class="lineNum">      79 </span>                :             {
<span class="lineNum">      80 </span><span class="lineNoCov">              0 :               const_iterator __mid = __x.begin() + difference_type(__len);</span>
<span class="lineNum">      81 </span><span class="lineNoCov">              0 :               std::copy(__x.begin(), __mid, this-&gt;_M_impl._M_start);</span>
<span class="lineNum">      82 </span><span class="lineNoCov">              0 :               insert(this-&gt;_M_impl._M_finish, __mid, __x.end());</span>
<span class="lineNum">      83 </span>                :             }
<span class="lineNum">      84 </span>                :         }
<span class="lineNum">      85 </span><span class="lineNoCov">              0 :       return *this;</span>
<span class="lineNum">      86 </span>                :     }
<span class="lineNum">      87 </span>                : 
<span class="lineNum">      88 </span>                :   template &lt;typename _Tp, typename _Alloc&gt;
<span class="lineNum">      89 </span>                :     typename deque&lt;_Tp, _Alloc&gt;::iterator
<span class="lineNum">      90 </span>                :     deque&lt;_Tp, _Alloc&gt;::
<span class="lineNum">      91 </span>                :     insert(iterator __position, const value_type&amp; __x)
<span class="lineNum">      92 </span>                :     {
<span class="lineNum">      93 </span>                :       if (__position._M_cur == this-&gt;_M_impl._M_start._M_cur)
<span class="lineNum">      94 </span>                :         {
<span class="lineNum">      95 </span>                :           push_front(__x);
<span class="lineNum">      96 </span>                :           return this-&gt;_M_impl._M_start;
<span class="lineNum">      97 </span>                :         }
<span class="lineNum">      98 </span>                :       else if (__position._M_cur == this-&gt;_M_impl._M_finish._M_cur)
<span class="lineNum">      99 </span>                :         {
<span class="lineNum">     100 </span>                :           push_back(__x);
<span class="lineNum">     101 </span>                :           iterator __tmp = this-&gt;_M_impl._M_finish;
<span class="lineNum">     102 </span>                :           --__tmp;
<span class="lineNum">     103 </span>                :           return __tmp;
<span class="lineNum">     104 </span>                :         }
<span class="lineNum">     105 </span>                :       else
<span class="lineNum">     106 </span>                :         return _M_insert_aux(__position, __x);
<span class="lineNum">     107 </span>                :     }
<span class="lineNum">     108 </span>                : 
<span class="lineNum">     109 </span>                : #ifdef __GXX_EXPERIMENTAL_CXX0X__
<span class="lineNum">     110 </span>                :   template&lt;typename _Tp, typename _Alloc&gt;
<span class="lineNum">     111 </span>                :     template&lt;typename... _Args&gt;
<span class="lineNum">     112 </span>                :       typename deque&lt;_Tp, _Alloc&gt;::iterator
<span class="lineNum">     113 </span>                :       deque&lt;_Tp, _Alloc&gt;::
<span class="lineNum">     114 </span>                :       emplace(iterator __position, _Args&amp;&amp;... __args)
<span class="lineNum">     115 </span>                :       {
<span class="lineNum">     116 </span>                :         if (__position._M_cur == this-&gt;_M_impl._M_start._M_cur)
<span class="lineNum">     117 </span>                :           {
<span class="lineNum">     118 </span>                :             push_front(std::forward&lt;_Args&gt;(__args)...);
<span class="lineNum">     119 </span>                :             return this-&gt;_M_impl._M_start;
<span class="lineNum">     120 </span>                :           }
<span class="lineNum">     121 </span>                :         else if (__position._M_cur == this-&gt;_M_impl._M_finish._M_cur)
<span class="lineNum">     122 </span>                :           {
<span class="lineNum">     123 </span>                :             push_back(std::forward&lt;_Args&gt;(__args)...);
<span class="lineNum">     124 </span>                :             iterator __tmp = this-&gt;_M_impl._M_finish;
<span class="lineNum">     125 </span>                :             --__tmp;
<span class="lineNum">     126 </span>                :             return __tmp;
<span class="lineNum">     127 </span>                :           }
<span class="lineNum">     128 </span>                :         else
<span class="lineNum">     129 </span>                :           return _M_insert_aux(__position, std::forward&lt;_Args&gt;(__args)...);
<span class="lineNum">     130 </span>                :       }
<span class="lineNum">     131 </span>                : #endif
<span class="lineNum">     132 </span>                : 
<span class="lineNum">     133 </span>                :   template &lt;typename _Tp, typename _Alloc&gt;
<span class="lineNum">     134 </span>                :     typename deque&lt;_Tp, _Alloc&gt;::iterator
<span class="lineNum">     135 </span>                :     deque&lt;_Tp, _Alloc&gt;::
<span class="lineNum">     136 </span>                :     erase(iterator __position)
<span class="lineNum">     137 </span>                :     {
<span class="lineNum">     138 </span>                :       iterator __next = __position;
<span class="lineNum">     139 </span>                :       ++__next;
<span class="lineNum">     140 </span>                :       const difference_type __index = __position - begin();
<span class="lineNum">     141 </span>                :       if (static_cast&lt;size_type&gt;(__index) &lt; (size() &gt;&gt; 1))
<span class="lineNum">     142 </span>                :         {
<span class="lineNum">     143 </span>                :           if (__position != begin())
<span class="lineNum">     144 </span>                :             _GLIBCXX_MOVE_BACKWARD3(begin(), __position, __next);
<span class="lineNum">     145 </span>                :           pop_front();
<span class="lineNum">     146 </span>                :         }
<span class="lineNum">     147 </span>                :       else
<span class="lineNum">     148 </span>                :         {
<span class="lineNum">     149 </span>                :           if (__next != end())
<span class="lineNum">     150 </span>                :             _GLIBCXX_MOVE3(__next, end(), __position);
<span class="lineNum">     151 </span>                :           pop_back();
<span class="lineNum">     152 </span>                :         }
<span class="lineNum">     153 </span>                :       return begin() + __index;
<span class="lineNum">     154 </span>                :     }
<span class="lineNum">     155 </span>                : 
<span class="lineNum">     156 </span>                :   template &lt;typename _Tp, typename _Alloc&gt;
<span class="lineNum">     157 </span>                :     typename deque&lt;_Tp, _Alloc&gt;::iterator
<span class="lineNum">     158 </span>                :     deque&lt;_Tp, _Alloc&gt;::
<span class="lineNum">     159 </span>                :     erase(iterator __first, iterator __last)
<span class="lineNum">     160 </span>                :     {
<span class="lineNum">     161 </span>                :       if (__first == begin() &amp;&amp; __last == end())
<span class="lineNum">     162 </span>                :         {
<span class="lineNum">     163 </span>                :           clear();
<span class="lineNum">     164 </span>                :           return end();
<span class="lineNum">     165 </span>                :         }
<span class="lineNum">     166 </span>                :       else
<span class="lineNum">     167 </span>                :         {
<span class="lineNum">     168 </span>                :           const difference_type __n = __last - __first;
<span class="lineNum">     169 </span>                :           const difference_type __elems_before = __first - begin();
<span class="lineNum">     170 </span>                :           if (static_cast&lt;size_type&gt;(__elems_before) &lt;= (size() - __n) / 2)
<span class="lineNum">     171 </span>                :             {
<span class="lineNum">     172 </span>                :               if (__first != begin())
<span class="lineNum">     173 </span>                :                 _GLIBCXX_MOVE_BACKWARD3(begin(), __first, __last);
<span class="lineNum">     174 </span>                :               _M_erase_at_begin(begin() + __n);
<span class="lineNum">     175 </span>                :             }
<span class="lineNum">     176 </span>                :           else
<span class="lineNum">     177 </span>                :             {
<span class="lineNum">     178 </span>                :               if (__last != end())
<span class="lineNum">     179 </span>                :                 _GLIBCXX_MOVE3(__last, end(), __first);
<span class="lineNum">     180 </span>                :               _M_erase_at_end(end() - __n);
<span class="lineNum">     181 </span>                :             }
<span class="lineNum">     182 </span>                :           return begin() + __elems_before;
<span class="lineNum">     183 </span>                :         }
<span class="lineNum">     184 </span>                :     }
<span class="lineNum">     185 </span>                : 
<span class="lineNum">     186 </span>                :   template &lt;typename _Tp, class _Alloc&gt;
<span class="lineNum">     187 </span>                :     template &lt;typename _InputIterator&gt;
<span class="lineNum">     188 </span>                :       void
<span class="lineNum">     189 </span>                :       deque&lt;_Tp, _Alloc&gt;::
<span class="lineNum">     190 </span>                :       _M_assign_aux(_InputIterator __first, _InputIterator __last,
<span class="lineNum">     191 </span>                :                     std::input_iterator_tag)
<span class="lineNum">     192 </span>                :       {
<span class="lineNum">     193 </span>                :         iterator __cur = begin();
<span class="lineNum">     194 </span>                :         for (; __first != __last &amp;&amp; __cur != end(); ++__cur, ++__first)
<span class="lineNum">     195 </span>                :           *__cur = *__first;
<span class="lineNum">     196 </span>                :         if (__first == __last)
<span class="lineNum">     197 </span>                :           _M_erase_at_end(__cur);
<span class="lineNum">     198 </span>                :         else
<span class="lineNum">     199 </span>                :           insert(end(), __first, __last);
<span class="lineNum">     200 </span>                :       }
<span class="lineNum">     201 </span>                : 
<span class="lineNum">     202 </span>                :   template &lt;typename _Tp, typename _Alloc&gt;
<span class="lineNum">     203 </span>                :     void
<span class="lineNum">     204 </span>                :     deque&lt;_Tp, _Alloc&gt;::
<span class="lineNum">     205 </span>                :     _M_fill_insert(iterator __pos, size_type __n, const value_type&amp; __x)
<span class="lineNum">     206 </span>                :     {
<span class="lineNum">     207 </span>                :       if (__pos._M_cur == this-&gt;_M_impl._M_start._M_cur)
<span class="lineNum">     208 </span>                :         {
<span class="lineNum">     209 </span>                :           iterator __new_start = _M_reserve_elements_at_front(__n);
<span class="lineNum">     210 </span>                :           try
<span class="lineNum">     211 </span>                :             {
<span class="lineNum">     212 </span>                :               std::__uninitialized_fill_a(__new_start, this-&gt;_M_impl._M_start,
<span class="lineNum">     213 </span>                :                                           __x, _M_get_Tp_allocator());
<span class="lineNum">     214 </span>                :               this-&gt;_M_impl._M_start = __new_start;
<span class="lineNum">     215 </span>                :             }
<span class="lineNum">     216 </span>                :           catch(...)
<span class="lineNum">     217 </span>                :             {
<span class="lineNum">     218 </span>                :               _M_destroy_nodes(__new_start._M_node,
<span class="lineNum">     219 </span>                :                                this-&gt;_M_impl._M_start._M_node);
<span class="lineNum">     220 </span>                :               __throw_exception_again;
<span class="lineNum">     221 </span>                :             }
<span class="lineNum">     222 </span>                :         }
<span class="lineNum">     223 </span>                :       else if (__pos._M_cur == this-&gt;_M_impl._M_finish._M_cur)
<span class="lineNum">     224 </span>                :         {
<span class="lineNum">     225 </span>                :           iterator __new_finish = _M_reserve_elements_at_back(__n);
<span class="lineNum">     226 </span>                :           try
<span class="lineNum">     227 </span>                :             {
<span class="lineNum">     228 </span>                :               std::__uninitialized_fill_a(this-&gt;_M_impl._M_finish,
<span class="lineNum">     229 </span>                :                                           __new_finish, __x,
<span class="lineNum">     230 </span>                :                                           _M_get_Tp_allocator());
<span class="lineNum">     231 </span>                :               this-&gt;_M_impl._M_finish = __new_finish;
<span class="lineNum">     232 </span>                :             }
<span class="lineNum">     233 </span>                :           catch(...)
<span class="lineNum">     234 </span>                :             {
<span class="lineNum">     235 </span>                :               _M_destroy_nodes(this-&gt;_M_impl._M_finish._M_node + 1,
<span class="lineNum">     236 </span>                :                                __new_finish._M_node + 1);
<span class="lineNum">     237 </span>                :               __throw_exception_again;
<span class="lineNum">     238 </span>                :             }
<span class="lineNum">     239 </span>                :         }
<span class="lineNum">     240 </span>                :       else
<span class="lineNum">     241 </span>                :         _M_insert_aux(__pos, __n, __x);
<span class="lineNum">     242 </span>                :     }
<span class="lineNum">     243 </span>                : 
<span class="lineNum">     244 </span>                :   template &lt;typename _Tp, typename _Alloc&gt;
<span class="lineNum">     245 </span>                :     void
<span class="lineNum">     246 </span>                :     deque&lt;_Tp, _Alloc&gt;::
<span class="lineNum">     247 </span>                :     _M_fill_initialize(const value_type&amp; __value)
<span class="lineNum">     248 </span>                :     {
<span class="lineNum">     249 </span>                :       _Map_pointer __cur;
<span class="lineNum">     250 </span>                :       try
<span class="lineNum">     251 </span>                :         {
<span class="lineNum">     252 </span>                :           for (__cur = this-&gt;_M_impl._M_start._M_node;
<span class="lineNum">     253 </span>                :                __cur &lt; this-&gt;_M_impl._M_finish._M_node;
<span class="lineNum">     254 </span>                :                ++__cur)
<span class="lineNum">     255 </span>                :             std::__uninitialized_fill_a(*__cur, *__cur + _S_buffer_size(),
<span class="lineNum">     256 </span>                :                                         __value, _M_get_Tp_allocator());
<span class="lineNum">     257 </span>                :           std::__uninitialized_fill_a(this-&gt;_M_impl._M_finish._M_first,
<span class="lineNum">     258 </span>                :                                       this-&gt;_M_impl._M_finish._M_cur,
<span class="lineNum">     259 </span>                :                                       __value, _M_get_Tp_allocator());
<span class="lineNum">     260 </span>                :         }
<span class="lineNum">     261 </span>                :       catch(...)
<span class="lineNum">     262 </span>                :         {
<span class="lineNum">     263 </span>                :           std::_Destroy(this-&gt;_M_impl._M_start, iterator(*__cur, __cur),
<span class="lineNum">     264 </span>                :                         _M_get_Tp_allocator());
<span class="lineNum">     265 </span>                :           __throw_exception_again;
<span class="lineNum">     266 </span>                :         }
<span class="lineNum">     267 </span>                :     }
<span class="lineNum">     268 </span>                : 
<span class="lineNum">     269 </span>                :   template &lt;typename _Tp, typename _Alloc&gt;
<span class="lineNum">     270 </span>                :     template &lt;typename _InputIterator&gt;
<span class="lineNum">     271 </span>                :       void
<span class="lineNum">     272 </span>                :       deque&lt;_Tp, _Alloc&gt;::
<span class="lineNum">     273 </span>                :       _M_range_initialize(_InputIterator __first, _InputIterator __last,
<span class="lineNum">     274 </span>                :                           std::input_iterator_tag)
<span class="lineNum">     275 </span>                :       {
<span class="lineNum">     276 </span>                :         this-&gt;_M_initialize_map(0);
<span class="lineNum">     277 </span>                :         try
<span class="lineNum">     278 </span>                :           {
<span class="lineNum">     279 </span>                :             for (; __first != __last; ++__first)
<span class="lineNum">     280 </span>                :               push_back(*__first);
<span class="lineNum">     281 </span>                :           }
<span class="lineNum">     282 </span>                :         catch(...)
<span class="lineNum">     283 </span>                :           {
<span class="lineNum">     284 </span>                :             clear();
<span class="lineNum">     285 </span>                :             __throw_exception_again;
<span class="lineNum">     286 </span>                :           }
<span class="lineNum">     287 </span>                :       }
<span class="lineNum">     288 </span>                : 
<span class="lineNum">     289 </span>                :   template &lt;typename _Tp, typename _Alloc&gt;
<span class="lineNum">     290 </span>                :     template &lt;typename _ForwardIterator&gt;
<span class="lineNum">     291 </span>                :       void
<span class="lineNum">     292 </span>                :       deque&lt;_Tp, _Alloc&gt;::
<span class="lineNum">     293 </span>                :       _M_range_initialize(_ForwardIterator __first, _ForwardIterator __last,
<span class="lineNum">     294 </span>                :                           std::forward_iterator_tag)
<span class="lineNum">     295 </span>                :       {
<span class="lineNum">     296 </span>                :         const size_type __n = std::distance(__first, __last);
<span class="lineNum">     297 </span>                :         this-&gt;_M_initialize_map(__n);
<span class="lineNum">     298 </span>                : 
<span class="lineNum">     299 </span>                :         _Map_pointer __cur_node;
<span class="lineNum">     300 </span>                :         try
<span class="lineNum">     301 </span>                :           {
<span class="lineNum">     302 </span>                :             for (__cur_node = this-&gt;_M_impl._M_start._M_node;
<span class="lineNum">     303 </span>                :                  __cur_node &lt; this-&gt;_M_impl._M_finish._M_node;
<span class="lineNum">     304 </span>                :                  ++__cur_node)
<span class="lineNum">     305 </span>                :               {
<span class="lineNum">     306 </span>                :                 _ForwardIterator __mid = __first;
<span class="lineNum">     307 </span>                :                 std::advance(__mid, _S_buffer_size());
<span class="lineNum">     308 </span>                :                 std::__uninitialized_copy_a(__first, __mid, *__cur_node,
<span class="lineNum">     309 </span>                :                                             _M_get_Tp_allocator());
<span class="lineNum">     310 </span>                :                 __first = __mid;
<span class="lineNum">     311 </span>                :               }
<span class="lineNum">     312 </span>                :             std::__uninitialized_copy_a(__first, __last,
<span class="lineNum">     313 </span>                :                                         this-&gt;_M_impl._M_finish._M_first,
<span class="lineNum">     314 </span>                :                                         _M_get_Tp_allocator());
<span class="lineNum">     315 </span>                :           }
<span class="lineNum">     316 </span>                :         catch(...)
<span class="lineNum">     317 </span>                :           {
<span class="lineNum">     318 </span>                :             std::_Destroy(this-&gt;_M_impl._M_start,
<span class="lineNum">     319 </span>                :                           iterator(*__cur_node, __cur_node),
<span class="lineNum">     320 </span>                :                           _M_get_Tp_allocator());
<span class="lineNum">     321 </span>                :             __throw_exception_again;
<span class="lineNum">     322 </span>                :           }
<span class="lineNum">     323 </span>                :       }
<span class="lineNum">     324 </span>                : 
<span class="lineNum">     325 </span>                :   // Called only if _M_impl._M_finish._M_cur == _M_impl._M_finish._M_last - 1.
<span class="lineNum">     326 </span>                :   template&lt;typename _Tp, typename _Alloc&gt;
<span class="lineNum">     327 </span>                : #ifdef __GXX_EXPERIMENTAL_CXX0X__
<span class="lineNum">     328 </span>                :     template&lt;typename... _Args&gt;
<span class="lineNum">     329 </span>                :       void
<span class="lineNum">     330 </span>                :       deque&lt;_Tp, _Alloc&gt;::
<span class="lineNum">     331 </span>                :       _M_push_back_aux(_Args&amp;&amp;... __args)
<span class="lineNum">     332 </span>                : #else
<span class="lineNum">     333 </span>                :       void
<span class="lineNum">     334 </span>                :       deque&lt;_Tp, _Alloc&gt;::
<span class="lineNum">     335 </span><span class="lineCov">          43449 :       _M_push_back_aux(const value_type&amp; __t)</span>
<span class="lineNum">     336 </span>                : #endif
<span class="lineNum">     337 </span>                :       {
<span class="lineNum">     338 </span><span class="lineCov">          43449 :         _M_reserve_map_at_back();</span>
<span class="lineNum">     339 </span><span class="lineCov">          43449 :         *(this-&gt;_M_impl._M_finish._M_node + 1) = this-&gt;_M_allocate_node();</span>
<span class="lineNum">     340 </span>                :         try
<span class="lineNum">     341 </span>                :           {
<span class="lineNum">     342 </span>                : #ifdef __GXX_EXPERIMENTAL_CXX0X__
<span class="lineNum">     343 </span>                :             this-&gt;_M_impl.construct(this-&gt;_M_impl._M_finish._M_cur,
<span class="lineNum">     344 </span>                :                                     std::forward&lt;_Args&gt;(__args)...);
<span class="lineNum">     345 </span>                : #else
<span class="lineNum">     346 </span><span class="lineCov">          43449 :             this-&gt;_M_impl.construct(this-&gt;_M_impl._M_finish._M_cur, __t);</span>
<span class="lineNum">     347 </span>                : #endif
<span class="lineNum">     348 </span><span class="lineCov">          43449 :             this-&gt;_M_impl._M_finish._M_set_node(this-&gt;_M_impl._M_finish._M_node</span>
<span class="lineNum">     349 </span>                :                                                 + 1);
<span class="lineNum">     350 </span><span class="lineCov">          43449 :             this-&gt;_M_impl._M_finish._M_cur = this-&gt;_M_impl._M_finish._M_first;</span>
<span class="lineNum">     351 </span>                :           }
<span class="lineNum">     352 </span><span class="lineNoCov">              0 :         catch(...)</span>
<span class="lineNum">     353 </span>                :           {
<span class="lineNum">     354 </span><span class="lineNoCov">              0 :             _M_deallocate_node(*(this-&gt;_M_impl._M_finish._M_node + 1));</span>
<span class="lineNum">     355 </span><span class="lineNoCov">              0 :             __throw_exception_again;</span>
<span class="lineNum">     356 </span>                :           }
<span class="lineNum">     357 </span><span class="lineCov">          43449 :       }</span>
<span class="lineNum">     358 </span>                : 
<span class="lineNum">     359 </span>                :   // Called only if _M_impl._M_start._M_cur == _M_impl._M_start._M_first.
<span class="lineNum">     360 </span>                :   template&lt;typename _Tp, typename _Alloc&gt;
<span class="lineNum">     361 </span>                : #ifdef __GXX_EXPERIMENTAL_CXX0X__
<span class="lineNum">     362 </span>                :     template&lt;typename... _Args&gt;
<span class="lineNum">     363 </span>                :       void
<span class="lineNum">     364 </span>                :       deque&lt;_Tp, _Alloc&gt;::
<span class="lineNum">     365 </span>                :       _M_push_front_aux(_Args&amp;&amp;... __args)
<span class="lineNum">     366 </span>                : #else
<span class="lineNum">     367 </span>                :       void
<span class="lineNum">     368 </span>                :       deque&lt;_Tp, _Alloc&gt;::
<span class="lineNum">     369 </span>                :       _M_push_front_aux(const value_type&amp; __t)
<span class="lineNum">     370 </span>                : #endif
<span class="lineNum">     371 </span>                :       {
<span class="lineNum">     372 </span>                :         _M_reserve_map_at_front();
<span class="lineNum">     373 </span>                :         *(this-&gt;_M_impl._M_start._M_node - 1) = this-&gt;_M_allocate_node();
<span class="lineNum">     374 </span>                :         try
<span class="lineNum">     375 </span>                :           {
<span class="lineNum">     376 </span>                :             this-&gt;_M_impl._M_start._M_set_node(this-&gt;_M_impl._M_start._M_node
<span class="lineNum">     377 </span>                :                                                - 1);
<span class="lineNum">     378 </span>                :             this-&gt;_M_impl._M_start._M_cur = this-&gt;_M_impl._M_start._M_last - 1;
<span class="lineNum">     379 </span>                : #ifdef __GXX_EXPERIMENTAL_CXX0X__
<span class="lineNum">     380 </span>                :             this-&gt;_M_impl.construct(this-&gt;_M_impl._M_start._M_cur,
<span class="lineNum">     381 </span>                :                                     std::forward&lt;_Args&gt;(__args)...);
<span class="lineNum">     382 </span>                : #else
<span class="lineNum">     383 </span>                :             this-&gt;_M_impl.construct(this-&gt;_M_impl._M_start._M_cur, __t);
<span class="lineNum">     384 </span>                : #endif
<span class="lineNum">     385 </span>                :           }
<span class="lineNum">     386 </span>                :         catch(...)
<span class="lineNum">     387 </span>                :           {
<span class="lineNum">     388 </span>                :             ++this-&gt;_M_impl._M_start;
<span class="lineNum">     389 </span>                :             _M_deallocate_node(*(this-&gt;_M_impl._M_start._M_node - 1));
<span class="lineNum">     390 </span>                :             __throw_exception_again;
<span class="lineNum">     391 </span>                :           }
<span class="lineNum">     392 </span>                :       }
<span class="lineNum">     393 </span>                : 
<span class="lineNum">     394 </span>                :   // Called only if _M_impl._M_finish._M_cur == _M_impl._M_finish._M_first.
<span class="lineNum">     395 </span>                :   template &lt;typename _Tp, typename _Alloc&gt;
<span class="lineNum">     396 </span>                :     void deque&lt;_Tp, _Alloc&gt;::
<span class="lineNum">     397 </span>                :     _M_pop_back_aux()
<span class="lineNum">     398 </span>                :     {
<span class="lineNum">     399 </span>                :       _M_deallocate_node(this-&gt;_M_impl._M_finish._M_first);
<span class="lineNum">     400 </span>                :       this-&gt;_M_impl._M_finish._M_set_node(this-&gt;_M_impl._M_finish._M_node - 1);
<span class="lineNum">     401 </span>                :       this-&gt;_M_impl._M_finish._M_cur = this-&gt;_M_impl._M_finish._M_last - 1;
<span class="lineNum">     402 </span>                :       this-&gt;_M_impl.destroy(this-&gt;_M_impl._M_finish._M_cur);
<span class="lineNum">     403 </span>                :     }
<span class="lineNum">     404 </span>                : 
<span class="lineNum">     405 </span>                :   // Called only if _M_impl._M_start._M_cur == _M_impl._M_start._M_last - 1.
<span class="lineNum">     406 </span>                :   // Note that if the deque has at least one element (a precondition for this
<span class="lineNum">     407 </span>                :   // member function), and if
<span class="lineNum">     408 </span>                :   //   _M_impl._M_start._M_cur == _M_impl._M_start._M_last,
<span class="lineNum">     409 </span>                :   // then the deque must have at least two nodes.
<span class="lineNum">     410 </span>                :   template &lt;typename _Tp, typename _Alloc&gt;
<span class="lineNum">     411 </span>                :     void deque&lt;_Tp, _Alloc&gt;::
<span class="lineNum">     412 </span>                :     _M_pop_front_aux()
<span class="lineNum">     413 </span>                :     {
<span class="lineNum">     414 </span><span class="lineCov">          43449 :       this-&gt;_M_impl.destroy(this-&gt;_M_impl._M_start._M_cur);</span>
<span class="lineNum">     415 </span><span class="lineCov">          43449 :       _M_deallocate_node(this-&gt;_M_impl._M_start._M_first);</span>
<span class="lineNum">     416 </span><span class="lineCov">          43449 :       this-&gt;_M_impl._M_start._M_set_node(this-&gt;_M_impl._M_start._M_node + 1);</span>
<span class="lineNum">     417 </span><span class="lineCov">          43449 :       this-&gt;_M_impl._M_start._M_cur = this-&gt;_M_impl._M_start._M_first;</span>
<span class="lineNum">     418 </span>                :     }
<span class="lineNum">     419 </span>                : 
<span class="lineNum">     420 </span>                :   template &lt;typename _Tp, typename _Alloc&gt;
<span class="lineNum">     421 </span>                :     template &lt;typename _InputIterator&gt;
<span class="lineNum">     422 </span>                :       void
<span class="lineNum">     423 </span>                :       deque&lt;_Tp, _Alloc&gt;::
<span class="lineNum">     424 </span>                :       _M_range_insert_aux(iterator __pos,
<span class="lineNum">     425 </span>                :                           _InputIterator __first, _InputIterator __last,
<span class="lineNum">     426 </span>                :                           std::input_iterator_tag)
<span class="lineNum">     427 </span>                :       { std::copy(__first, __last, std::inserter(*this, __pos)); }
<span class="lineNum">     428 </span>                : 
<span class="lineNum">     429 </span>                :   template &lt;typename _Tp, typename _Alloc&gt;
<span class="lineNum">     430 </span>                :     template &lt;typename _ForwardIterator&gt;
<span class="lineNum">     431 </span>                :       void
<span class="lineNum">     432 </span>                :       deque&lt;_Tp, _Alloc&gt;::
<span class="lineNum">     433 </span>                :       _M_range_insert_aux(iterator __pos,
<span class="lineNum">     434 </span>                :                           _ForwardIterator __first, _ForwardIterator __last,
<span class="lineNum">     435 </span><span class="lineNoCov">              0 :                           std::forward_iterator_tag)</span>
<span class="lineNum">     436 </span>                :       {
<span class="lineNum">     437 </span><span class="lineNoCov">              0 :         const size_type __n = std::distance(__first, __last);</span>
<span class="lineNum">     438 </span><span class="lineNoCov">              0 :         if (__pos._M_cur == this-&gt;_M_impl._M_start._M_cur)</span>
<span class="lineNum">     439 </span>                :           {
<span class="lineNum">     440 </span><span class="lineNoCov">              0 :             iterator __new_start = _M_reserve_elements_at_front(__n);</span>
<span class="lineNum">     441 </span>                :             try
<span class="lineNum">     442 </span>                :               {
<span class="lineNum">     443 </span><span class="lineNoCov">              0 :                 std::__uninitialized_copy_a(__first, __last, __new_start,</span>
<span class="lineNum">     444 </span>                :                                             _M_get_Tp_allocator());
<span class="lineNum">     445 </span><span class="lineNoCov">              0 :                 this-&gt;_M_impl._M_start = __new_start;</span>
<span class="lineNum">     446 </span>                :               }
<span class="lineNum">     447 </span><span class="lineNoCov">              0 :             catch(...)</span>
<span class="lineNum">     448 </span>                :               {
<span class="lineNum">     449 </span><span class="lineNoCov">              0 :                 _M_destroy_nodes(__new_start._M_node,</span>
<span class="lineNum">     450 </span>                :                                  this-&gt;_M_impl._M_start._M_node);
<span class="lineNum">     451 </span><span class="lineNoCov">              0 :                 __throw_exception_again;</span>
<span class="lineNum">     452 </span>                :               }
<span class="lineNum">     453 </span>                :           }
<span class="lineNum">     454 </span><span class="lineNoCov">              0 :         else if (__pos._M_cur == this-&gt;_M_impl._M_finish._M_cur)</span>
<span class="lineNum">     455 </span>                :           {
<span class="lineNum">     456 </span><span class="lineNoCov">              0 :             iterator __new_finish = _M_reserve_elements_at_back(__n);</span>
<span class="lineNum">     457 </span>                :             try
<span class="lineNum">     458 </span>                :               {
<span class="lineNum">     459 </span><span class="lineNoCov">              0 :                 std::__uninitialized_copy_a(__first, __last,</span>
<span class="lineNum">     460 </span>                :                                             this-&gt;_M_impl._M_finish,
<span class="lineNum">     461 </span>                :                                             _M_get_Tp_allocator());
<span class="lineNum">     462 </span><span class="lineNoCov">              0 :                 this-&gt;_M_impl._M_finish = __new_finish;</span>
<span class="lineNum">     463 </span>                :               }
<span class="lineNum">     464 </span><span class="lineNoCov">              0 :             catch(...)</span>
<span class="lineNum">     465 </span>                :               {
<span class="lineNum">     466 </span><span class="lineNoCov">              0 :                 _M_destroy_nodes(this-&gt;_M_impl._M_finish._M_node + 1,</span>
<span class="lineNum">     467 </span>                :                                  __new_finish._M_node + 1);
<span class="lineNum">     468 </span><span class="lineNoCov">              0 :                 __throw_exception_again;</span>
<span class="lineNum">     469 </span>                :               }
<span class="lineNum">     470 </span>                :           }
<span class="lineNum">     471 </span>                :         else
<span class="lineNum">     472 </span><span class="lineNoCov">              0 :           _M_insert_aux(__pos, __first, __last, __n);</span>
<span class="lineNum">     473 </span><span class="lineNoCov">              0 :       }</span>
<span class="lineNum">     474 </span>                : 
<span class="lineNum">     475 </span>                :   template&lt;typename _Tp, typename _Alloc&gt;
<span class="lineNum">     476 </span>                : #ifdef __GXX_EXPERIMENTAL_CXX0X__
<span class="lineNum">     477 </span>                :     template&lt;typename... _Args&gt;
<span class="lineNum">     478 </span>                :       typename deque&lt;_Tp, _Alloc&gt;::iterator
<span class="lineNum">     479 </span>                :       deque&lt;_Tp, _Alloc&gt;::
<span class="lineNum">     480 </span>                :       _M_insert_aux(iterator __pos, _Args&amp;&amp;... __args)
<span class="lineNum">     481 </span>                :       {
<span class="lineNum">     482 </span>                :         value_type __x_copy(std::forward&lt;_Args&gt;(__args)...); // XXX copy
<span class="lineNum">     483 </span>                : #else
<span class="lineNum">     484 </span>                :     typename deque&lt;_Tp, _Alloc&gt;::iterator
<span class="lineNum">     485 </span>                :       deque&lt;_Tp, _Alloc&gt;::
<span class="lineNum">     486 </span>                :       _M_insert_aux(iterator __pos, const value_type&amp; __x)
<span class="lineNum">     487 </span>                :       {
<span class="lineNum">     488 </span>                :         value_type __x_copy = __x; // XXX copy
<span class="lineNum">     489 </span>                : #endif
<span class="lineNum">     490 </span>                :         difference_type __index = __pos - this-&gt;_M_impl._M_start;
<span class="lineNum">     491 </span>                :         if (static_cast&lt;size_type&gt;(__index) &lt; size() / 2)
<span class="lineNum">     492 </span>                :           {
<span class="lineNum">     493 </span>                :             push_front(_GLIBCXX_MOVE(front()));
<span class="lineNum">     494 </span>                :             iterator __front1 = this-&gt;_M_impl._M_start;
<span class="lineNum">     495 </span>                :             ++__front1;
<span class="lineNum">     496 </span>                :             iterator __front2 = __front1;
<span class="lineNum">     497 </span>                :             ++__front2;
<span class="lineNum">     498 </span>                :             __pos = this-&gt;_M_impl._M_start + __index;
<span class="lineNum">     499 </span>                :             iterator __pos1 = __pos;
<span class="lineNum">     500 </span>                :             ++__pos1;
<span class="lineNum">     501 </span>                :             _GLIBCXX_MOVE3(__front2, __pos1, __front1);
<span class="lineNum">     502 </span>                :           }
<span class="lineNum">     503 </span>                :         else
<span class="lineNum">     504 </span>                :           {
<span class="lineNum">     505 </span>                :             push_back(_GLIBCXX_MOVE(back()));
<span class="lineNum">     506 </span>                :             iterator __back1 = this-&gt;_M_impl._M_finish;
<span class="lineNum">     507 </span>                :             --__back1;
<span class="lineNum">     508 </span>                :             iterator __back2 = __back1;
<span class="lineNum">     509 </span>                :             --__back2;
<span class="lineNum">     510 </span>                :             __pos = this-&gt;_M_impl._M_start + __index;
<span class="lineNum">     511 </span>                :             _GLIBCXX_MOVE_BACKWARD3(__pos, __back2, __back1);
<span class="lineNum">     512 </span>                :           }
<span class="lineNum">     513 </span>                :         *__pos = _GLIBCXX_MOVE(__x_copy);
<span class="lineNum">     514 </span>                :         return __pos;
<span class="lineNum">     515 </span>                :       }
<span class="lineNum">     516 </span>                : 
<span class="lineNum">     517 </span>                :   template &lt;typename _Tp, typename _Alloc&gt;
<span class="lineNum">     518 </span>                :     void
<span class="lineNum">     519 </span>                :     deque&lt;_Tp, _Alloc&gt;::
<span class="lineNum">     520 </span>                :     _M_insert_aux(iterator __pos, size_type __n, const value_type&amp; __x)
<span class="lineNum">     521 </span>                :     {
<span class="lineNum">     522 </span>                :       const difference_type __elems_before = __pos - this-&gt;_M_impl._M_start;
<span class="lineNum">     523 </span>                :       const size_type __length = this-&gt;size();
<span class="lineNum">     524 </span>                :       value_type __x_copy = __x;
<span class="lineNum">     525 </span>                :       if (__elems_before &lt; difference_type(__length / 2))
<span class="lineNum">     526 </span>                :         {
<span class="lineNum">     527 </span>                :           iterator __new_start = _M_reserve_elements_at_front(__n);
<span class="lineNum">     528 </span>                :           iterator __old_start = this-&gt;_M_impl._M_start;
<span class="lineNum">     529 </span>                :           __pos = this-&gt;_M_impl._M_start + __elems_before;
<span class="lineNum">     530 </span>                :           try
<span class="lineNum">     531 </span>                :             {
<span class="lineNum">     532 </span>                :               if (__elems_before &gt;= difference_type(__n))
<span class="lineNum">     533 </span>                :                 {
<span class="lineNum">     534 </span>                :                   iterator __start_n = (this-&gt;_M_impl._M_start
<span class="lineNum">     535 </span>                :                                         + difference_type(__n));
<span class="lineNum">     536 </span>                :                   std::__uninitialized_move_a(this-&gt;_M_impl._M_start,
<span class="lineNum">     537 </span>                :                                               __start_n, __new_start,
<span class="lineNum">     538 </span>                :                                               _M_get_Tp_allocator());
<span class="lineNum">     539 </span>                :                   this-&gt;_M_impl._M_start = __new_start;
<span class="lineNum">     540 </span>                :                   _GLIBCXX_MOVE3(__start_n, __pos, __old_start);
<span class="lineNum">     541 </span>                :                   std::fill(__pos - difference_type(__n), __pos, __x_copy);
<span class="lineNum">     542 </span>                :                 }
<span class="lineNum">     543 </span>                :               else
<span class="lineNum">     544 </span>                :                 {
<span class="lineNum">     545 </span>                :                   std::__uninitialized_move_fill(this-&gt;_M_impl._M_start,
<span class="lineNum">     546 </span>                :                                                  __pos, __new_start,
<span class="lineNum">     547 </span>                :                                                  this-&gt;_M_impl._M_start,
<span class="lineNum">     548 </span>                :                                                  __x_copy,
<span class="lineNum">     549 </span>                :                                                  _M_get_Tp_allocator());
<span class="lineNum">     550 </span>                :                   this-&gt;_M_impl._M_start = __new_start;
<span class="lineNum">     551 </span>                :                   std::fill(__old_start, __pos, __x_copy);
<span class="lineNum">     552 </span>                :                 }
<span class="lineNum">     553 </span>                :             }
<span class="lineNum">     554 </span>                :           catch(...)
<span class="lineNum">     555 </span>                :             {
<span class="lineNum">     556 </span>                :               _M_destroy_nodes(__new_start._M_node,
<span class="lineNum">     557 </span>                :                                this-&gt;_M_impl._M_start._M_node);
<span class="lineNum">     558 </span>                :               __throw_exception_again;
<span class="lineNum">     559 </span>                :             }
<span class="lineNum">     560 </span>                :         }
<span class="lineNum">     561 </span>                :       else
<span class="lineNum">     562 </span>                :         {
<span class="lineNum">     563 </span>                :           iterator __new_finish = _M_reserve_elements_at_back(__n);
<span class="lineNum">     564 </span>                :           iterator __old_finish = this-&gt;_M_impl._M_finish;
<span class="lineNum">     565 </span>                :           const difference_type __elems_after =
<span class="lineNum">     566 </span>                :             difference_type(__length) - __elems_before;
<span class="lineNum">     567 </span>                :           __pos = this-&gt;_M_impl._M_finish - __elems_after;
<span class="lineNum">     568 </span>                :           try
<span class="lineNum">     569 </span>                :             {
<span class="lineNum">     570 </span>                :               if (__elems_after &gt; difference_type(__n))
<span class="lineNum">     571 </span>                :                 {
<span class="lineNum">     572 </span>                :                   iterator __finish_n = (this-&gt;_M_impl._M_finish
<span class="lineNum">     573 </span>                :                                          - difference_type(__n));
<span class="lineNum">     574 </span>                :                   std::__uninitialized_move_a(__finish_n,
<span class="lineNum">     575 </span>                :                                               this-&gt;_M_impl._M_finish,
<span class="lineNum">     576 </span>                :                                               this-&gt;_M_impl._M_finish,
<span class="lineNum">     577 </span>                :                                               _M_get_Tp_allocator());
<span class="lineNum">     578 </span>                :                   this-&gt;_M_impl._M_finish = __new_finish;
<span class="lineNum">     579 </span>                :                   _GLIBCXX_MOVE_BACKWARD3(__pos, __finish_n, __old_finish);
<span class="lineNum">     580 </span>                :                   std::fill(__pos, __pos + difference_type(__n), __x_copy);
<span class="lineNum">     581 </span>                :                 }
<span class="lineNum">     582 </span>                :               else
<span class="lineNum">     583 </span>                :                 {
<span class="lineNum">     584 </span>                :                   std::__uninitialized_fill_move(this-&gt;_M_impl._M_finish,
<span class="lineNum">     585 </span>                :                                                  __pos + difference_type(__n),
<span class="lineNum">     586 </span>                :                                                  __x_copy, __pos,
<span class="lineNum">     587 </span>                :                                                  this-&gt;_M_impl._M_finish,
<span class="lineNum">     588 </span>                :                                                  _M_get_Tp_allocator());
<span class="lineNum">     589 </span>                :                   this-&gt;_M_impl._M_finish = __new_finish;
<span class="lineNum">     590 </span>                :                   std::fill(__pos, __old_finish, __x_copy);
<span class="lineNum">     591 </span>                :                 }
<span class="lineNum">     592 </span>                :             }
<span class="lineNum">     593 </span>                :           catch(...)
<span class="lineNum">     594 </span>                :             {
<span class="lineNum">     595 </span>                :               _M_destroy_nodes(this-&gt;_M_impl._M_finish._M_node + 1,
<span class="lineNum">     596 </span>                :                                __new_finish._M_node + 1);
<span class="lineNum">     597 </span>                :               __throw_exception_again;
<span class="lineNum">     598 </span>                :             }
<span class="lineNum">     599 </span>                :         }
<span class="lineNum">     600 </span>                :     }
<span class="lineNum">     601 </span>                : 
<span class="lineNum">     602 </span>                :   template &lt;typename _Tp, typename _Alloc&gt;
<span class="lineNum">     603 </span>                :     template &lt;typename _ForwardIterator&gt;
<span class="lineNum">     604 </span>                :       void
<span class="lineNum">     605 </span>                :       deque&lt;_Tp, _Alloc&gt;::
<span class="lineNum">     606 </span>                :       _M_insert_aux(iterator __pos,
<span class="lineNum">     607 </span>                :                     _ForwardIterator __first, _ForwardIterator __last,
<span class="lineNum">     608 </span><span class="lineNoCov">              0 :                     size_type __n)</span>
<span class="lineNum">     609 </span>                :       {
<span class="lineNum">     610 </span><span class="lineNoCov">              0 :         const difference_type __elemsbefore = __pos - this-&gt;_M_impl._M_start;</span>
<span class="lineNum">     611 </span><span class="lineNoCov">              0 :         const size_type __length = size();</span>
<span class="lineNum">     612 </span><span class="lineNoCov">              0 :         if (static_cast&lt;size_type&gt;(__elemsbefore) &lt; __length / 2)</span>
<span class="lineNum">     613 </span>                :           {
<span class="lineNum">     614 </span><span class="lineNoCov">              0 :             iterator __new_start = _M_reserve_elements_at_front(__n);</span>
<span class="lineNum">     615 </span><span class="lineNoCov">              0 :             iterator __old_start = this-&gt;_M_impl._M_start;</span>
<span class="lineNum">     616 </span><span class="lineNoCov">              0 :             __pos = this-&gt;_M_impl._M_start + __elemsbefore;</span>
<span class="lineNum">     617 </span>                :             try
<span class="lineNum">     618 </span>                :               {
<span class="lineNum">     619 </span><span class="lineNoCov">              0 :                 if (__elemsbefore &gt;= difference_type(__n))</span>
<span class="lineNum">     620 </span>                :                   {
<span class="lineNum">     621 </span>                :                     iterator __start_n = (this-&gt;_M_impl._M_start
<span class="lineNum">     622 </span><span class="lineNoCov">              0 :                                           + difference_type(__n));</span>
<span class="lineNum">     623 </span><span class="lineNoCov">              0 :                     std::__uninitialized_move_a(this-&gt;_M_impl._M_start,</span>
<span class="lineNum">     624 </span>                :                                                 __start_n, __new_start,
<span class="lineNum">     625 </span>                :                                                 _M_get_Tp_allocator());
<span class="lineNum">     626 </span><span class="lineNoCov">              0 :                     this-&gt;_M_impl._M_start = __new_start;</span>
<span class="lineNum">     627 </span><span class="lineNoCov">              0 :                     _GLIBCXX_MOVE3(__start_n, __pos, __old_start);</span>
<span class="lineNum">     628 </span><span class="lineNoCov">              0 :                     std::copy(__first, __last, __pos - difference_type(__n));</span>
<span class="lineNum">     629 </span>                :                   }
<span class="lineNum">     630 </span>                :                 else
<span class="lineNum">     631 </span>                :                   {
<span class="lineNum">     632 </span><span class="lineNoCov">              0 :                     _ForwardIterator __mid = __first;</span>
<span class="lineNum">     633 </span><span class="lineNoCov">              0 :                     std::advance(__mid, difference_type(__n) - __elemsbefore);</span>
<span class="lineNum">     634 </span><span class="lineNoCov">              0 :                     std::__uninitialized_move_copy(this-&gt;_M_impl._M_start,</span>
<span class="lineNum">     635 </span>                :                                                    __pos, __first, __mid,
<span class="lineNum">     636 </span>                :                                                    __new_start,
<span class="lineNum">     637 </span>                :                                                    _M_get_Tp_allocator());
<span class="lineNum">     638 </span><span class="lineNoCov">              0 :                     this-&gt;_M_impl._M_start = __new_start;</span>
<span class="lineNum">     639 </span><span class="lineNoCov">              0 :                     std::copy(__mid, __last, __old_start);</span>
<span class="lineNum">     640 </span>                :                   }
<span class="lineNum">     641 </span>                :               }
<span class="lineNum">     642 </span><span class="lineNoCov">              0 :             catch(...)</span>
<span class="lineNum">     643 </span>                :               {
<span class="lineNum">     644 </span><span class="lineNoCov">              0 :                 _M_destroy_nodes(__new_start._M_node,</span>
<span class="lineNum">     645 </span>                :                                  this-&gt;_M_impl._M_start._M_node);
<span class="lineNum">     646 </span><span class="lineNoCov">              0 :                 __throw_exception_again;</span>
<span class="lineNum">     647 </span>                :               }
<span class="lineNum">     648 </span>                :           }
<span class="lineNum">     649 </span>                :         else
<span class="lineNum">     650 </span>                :         {
<span class="lineNum">     651 </span><span class="lineNoCov">              0 :           iterator __new_finish = _M_reserve_elements_at_back(__n);</span>
<span class="lineNum">     652 </span><span class="lineNoCov">              0 :           iterator __old_finish = this-&gt;_M_impl._M_finish;</span>
<span class="lineNum">     653 </span>                :           const difference_type __elemsafter =
<span class="lineNum">     654 </span><span class="lineNoCov">              0 :             difference_type(__length) - __elemsbefore;</span>
<span class="lineNum">     655 </span><span class="lineNoCov">              0 :           __pos = this-&gt;_M_impl._M_finish - __elemsafter;</span>
<span class="lineNum">     656 </span>                :           try
<span class="lineNum">     657 </span>                :             {
<span class="lineNum">     658 </span><span class="lineNoCov">              0 :               if (__elemsafter &gt; difference_type(__n))</span>
<span class="lineNum">     659 </span>                :                 {
<span class="lineNum">     660 </span>                :                   iterator __finish_n = (this-&gt;_M_impl._M_finish
<span class="lineNum">     661 </span><span class="lineNoCov">              0 :                                          - difference_type(__n));</span>
<span class="lineNum">     662 </span><span class="lineNoCov">              0 :                   std::__uninitialized_move_a(__finish_n,</span>
<span class="lineNum">     663 </span>                :                                               this-&gt;_M_impl._M_finish,
<span class="lineNum">     664 </span>                :                                               this-&gt;_M_impl._M_finish,
<span class="lineNum">     665 </span>                :                                               _M_get_Tp_allocator());
<span class="lineNum">     666 </span><span class="lineNoCov">              0 :                   this-&gt;_M_impl._M_finish = __new_finish;</span>
<span class="lineNum">     667 </span><span class="lineNoCov">              0 :                   _GLIBCXX_MOVE_BACKWARD3(__pos, __finish_n, __old_finish);</span>
<span class="lineNum">     668 </span><span class="lineNoCov">              0 :                   std::copy(__first, __last, __pos);</span>
<span class="lineNum">     669 </span>                :                 }
<span class="lineNum">     670 </span>                :               else
<span class="lineNum">     671 </span>                :                 {
<span class="lineNum">     672 </span><span class="lineNoCov">              0 :                   _ForwardIterator __mid = __first;</span>
<span class="lineNum">     673 </span><span class="lineNoCov">              0 :                   std::advance(__mid, __elemsafter);</span>
<span class="lineNum">     674 </span><span class="lineNoCov">              0 :                   std::__uninitialized_copy_move(__mid, __last, __pos,</span>
<span class="lineNum">     675 </span>                :                                                  this-&gt;_M_impl._M_finish,
<span class="lineNum">     676 </span>                :                                                  this-&gt;_M_impl._M_finish,
<span class="lineNum">     677 </span>                :                                                  _M_get_Tp_allocator());
<span class="lineNum">     678 </span><span class="lineNoCov">              0 :                   this-&gt;_M_impl._M_finish = __new_finish;</span>
<span class="lineNum">     679 </span><span class="lineNoCov">              0 :                   std::copy(__first, __mid, __pos);</span>
<span class="lineNum">     680 </span>                :                 }
<span class="lineNum">     681 </span>                :             }
<span class="lineNum">     682 </span><span class="lineNoCov">              0 :           catch(...)</span>
<span class="lineNum">     683 </span>                :             {
<span class="lineNum">     684 </span><span class="lineNoCov">              0 :               _M_destroy_nodes(this-&gt;_M_impl._M_finish._M_node + 1,</span>
<span class="lineNum">     685 </span>                :                                __new_finish._M_node + 1);
<span class="lineNum">     686 </span><span class="lineNoCov">              0 :               __throw_exception_again;</span>
<span class="lineNum">     687 </span>                :             }
<span class="lineNum">     688 </span>                :         }
<span class="lineNum">     689 </span><span class="lineNoCov">              0 :       }</span>
<span class="lineNum">     690 </span>                : 
<span class="lineNum">     691 </span>                :    template&lt;typename _Tp, typename _Alloc&gt;
<span class="lineNum">     692 </span>                :      void
<span class="lineNum">     693 </span>                :      deque&lt;_Tp, _Alloc&gt;::
<span class="lineNum">     694 </span>                :      _M_destroy_data_aux(iterator __first, iterator __last)
<span class="lineNum">     695 </span>                :      {
<span class="lineNum">     696 </span><span class="lineCov">            128 :        for (_Map_pointer __node = __first._M_node + 1;</span>
<span class="lineNum">     697 </span>                :             __node &lt; __last._M_node; ++__node)
<span class="lineNum">     698 </span><span class="lineNoCov">              0 :          std::_Destroy(*__node, *__node + _S_buffer_size(),</span>
<span class="lineNum">     699 </span>                :                        _M_get_Tp_allocator());
<span class="lineNum">     700 </span>                : 
<span class="lineNum">     701 </span><span class="lineCov">            128 :        if (__first._M_node != __last._M_node)</span>
<span class="lineNum">     702 </span>                :          {
<span class="lineNum">     703 </span><span class="lineNoCov">              0 :            std::_Destroy(__first._M_cur, __first._M_last,</span>
<span class="lineNum">     704 </span>                :                          _M_get_Tp_allocator());
<span class="lineNum">     705 </span><span class="lineNoCov">              0 :            std::_Destroy(__last._M_first, __last._M_cur,</span>
<span class="lineNum">     706 </span>                :                          _M_get_Tp_allocator());
<span class="lineNum">     707 </span>                :          }
<span class="lineNum">     708 </span>                :        else
<span class="lineNum">     709 </span><span class="lineCov">            256 :          std::_Destroy(__first._M_cur, __last._M_cur,</span>
<span class="lineNum">     710 </span>                :                        _M_get_Tp_allocator());
<span class="lineNum">     711 </span>                :      }
<span class="lineNum">     712 </span>                : 
<span class="lineNum">     713 </span>                :   template &lt;typename _Tp, typename _Alloc&gt;
<span class="lineNum">     714 </span>                :     void
<span class="lineNum">     715 </span>                :     deque&lt;_Tp, _Alloc&gt;::
<span class="lineNum">     716 </span><span class="lineNoCov">              0 :     _M_new_elements_at_front(size_type __new_elems)</span>
<span class="lineNum">     717 </span>                :     {
<span class="lineNum">     718 </span><span class="lineNoCov">              0 :       if (this-&gt;max_size() - this-&gt;size() &lt; __new_elems)</span>
<span class="lineNum">     719 </span><span class="lineNoCov">              0 :         __throw_length_error(__N(&quot;deque::_M_new_elements_at_front&quot;));</span>
<span class="lineNum">     720 </span>                : 
<span class="lineNum">     721 </span>                :       const size_type __new_nodes = ((__new_elems + _S_buffer_size() - 1)
<span class="lineNum">     722 </span><span class="lineNoCov">              0 :                                      / _S_buffer_size());</span>
<span class="lineNum">     723 </span><span class="lineNoCov">              0 :       _M_reserve_map_at_front(__new_nodes);</span>
<span class="lineNum">     724 </span>                :       size_type __i;
<span class="lineNum">     725 </span>                :       try
<span class="lineNum">     726 </span>                :         {
<span class="lineNum">     727 </span><span class="lineNoCov">              0 :           for (__i = 1; __i &lt;= __new_nodes; ++__i)</span>
<span class="lineNum">     728 </span><span class="lineNoCov">              0 :             *(this-&gt;_M_impl._M_start._M_node - __i) = this-&gt;_M_allocate_node();</span>
<span class="lineNum">     729 </span>                :         }
<span class="lineNum">     730 </span><span class="lineNoCov">              0 :       catch(...)</span>
<span class="lineNum">     731 </span>                :         {
<span class="lineNum">     732 </span><span class="lineNoCov">              0 :           for (size_type __j = 1; __j &lt; __i; ++__j)</span>
<span class="lineNum">     733 </span><span class="lineNoCov">              0 :             _M_deallocate_node(*(this-&gt;_M_impl._M_start._M_node - __j));</span>
<span class="lineNum">     734 </span><span class="lineNoCov">              0 :           __throw_exception_again;</span>
<span class="lineNum">     735 </span>                :         }
<span class="lineNum">     736 </span><span class="lineNoCov">              0 :     }</span>
<span class="lineNum">     737 </span>                : 
<span class="lineNum">     738 </span>                :   template &lt;typename _Tp, typename _Alloc&gt;
<span class="lineNum">     739 </span>                :     void
<span class="lineNum">     740 </span>                :     deque&lt;_Tp, _Alloc&gt;::
<span class="lineNum">     741 </span><span class="lineNoCov">              0 :     _M_new_elements_at_back(size_type __new_elems)</span>
<span class="lineNum">     742 </span>                :     {
<span class="lineNum">     743 </span><span class="lineNoCov">              0 :       if (this-&gt;max_size() - this-&gt;size() &lt; __new_elems)</span>
<span class="lineNum">     744 </span><span class="lineNoCov">              0 :         __throw_length_error(__N(&quot;deque::_M_new_elements_at_back&quot;));</span>
<span class="lineNum">     745 </span>                : 
<span class="lineNum">     746 </span>                :       const size_type __new_nodes = ((__new_elems + _S_buffer_size() - 1)
<span class="lineNum">     747 </span><span class="lineNoCov">              0 :                                      / _S_buffer_size());</span>
<span class="lineNum">     748 </span><span class="lineNoCov">              0 :       _M_reserve_map_at_back(__new_nodes);</span>
<span class="lineNum">     749 </span>                :       size_type __i;
<span class="lineNum">     750 </span>                :       try
<span class="lineNum">     751 </span>                :         {
<span class="lineNum">     752 </span><span class="lineNoCov">              0 :           for (__i = 1; __i &lt;= __new_nodes; ++__i)</span>
<span class="lineNum">     753 </span><span class="lineNoCov">              0 :             *(this-&gt;_M_impl._M_finish._M_node + __i) = this-&gt;_M_allocate_node();</span>
<span class="lineNum">     754 </span>                :         }
<span class="lineNum">     755 </span><span class="lineNoCov">              0 :       catch(...)</span>
<span class="lineNum">     756 </span>                :         {
<span class="lineNum">     757 </span><span class="lineNoCov">              0 :           for (size_type __j = 1; __j &lt; __i; ++__j)</span>
<span class="lineNum">     758 </span><span class="lineNoCov">              0 :             _M_deallocate_node(*(this-&gt;_M_impl._M_finish._M_node + __j));</span>
<span class="lineNum">     759 </span><span class="lineNoCov">              0 :           __throw_exception_again;</span>
<span class="lineNum">     760 </span>                :         }
<span class="lineNum">     761 </span><span class="lineNoCov">              0 :     }</span>
<span class="lineNum">     762 </span>                : 
<span class="lineNum">     763 </span>                :   template &lt;typename _Tp, typename _Alloc&gt;
<span class="lineNum">     764 </span>                :     void
<span class="lineNum">     765 </span>                :     deque&lt;_Tp, _Alloc&gt;::
<span class="lineNum">     766 </span><span class="lineCov">          10568 :     _M_reallocate_map(size_type __nodes_to_add, bool __add_at_front)</span>
<span class="lineNum">     767 </span>                :     {
<span class="lineNum">     768 </span>                :       const size_type __old_num_nodes
<span class="lineNum">     769 </span><span class="lineCov">          10568 :         = this-&gt;_M_impl._M_finish._M_node - this-&gt;_M_impl._M_start._M_node + 1;</span>
<span class="lineNum">     770 </span><span class="lineCov">          10568 :       const size_type __new_num_nodes = __old_num_nodes + __nodes_to_add;</span>
<span class="lineNum">     771 </span>                : 
<span class="lineNum">     772 </span>                :       _Map_pointer __new_nstart;
<span class="lineNum">     773 </span><span class="lineCov">          10568 :       if (this-&gt;_M_impl._M_map_size &gt; 2 * __new_num_nodes)</span>
<span class="lineNum">     774 </span>                :         {
<span class="lineNum">     775 </span><span class="lineCov">          10568 :           __new_nstart = this-&gt;_M_impl._M_map + (this-&gt;_M_impl._M_map_size</span>
<span class="lineNum">     776 </span>                :                                          - __new_num_nodes) / 2
<span class="lineNum">     777 </span>                :                          + (__add_at_front ? __nodes_to_add : 0);
<span class="lineNum">     778 </span><span class="lineCov">          10568 :           if (__new_nstart &lt; this-&gt;_M_impl._M_start._M_node)</span>
<span class="lineNum">     779 </span><span class="lineCov">          10568 :             std::copy(this-&gt;_M_impl._M_start._M_node,</span>
<span class="lineNum">     780 </span>                :                       this-&gt;_M_impl._M_finish._M_node + 1,
<span class="lineNum">     781 </span>                :                       __new_nstart);
<span class="lineNum">     782 </span>                :           else
<span class="lineNum">     783 </span><span class="lineNoCov">              0 :             std::copy_backward(this-&gt;_M_impl._M_start._M_node,</span>
<span class="lineNum">     784 </span>                :                                this-&gt;_M_impl._M_finish._M_node + 1,
<span class="lineNum">     785 </span>                :                                __new_nstart + __old_num_nodes);
<span class="lineNum">     786 </span>                :         }
<span class="lineNum">     787 </span>                :       else
<span class="lineNum">     788 </span>                :         {
<span class="lineNum">     789 </span>                :           size_type __new_map_size = this-&gt;_M_impl._M_map_size
<span class="lineNum">     790 </span>                :                                      + std::max(this-&gt;_M_impl._M_map_size,
<span class="lineNum">     791 </span><span class="lineNoCov">              0 :                                                 __nodes_to_add) + 2;</span>
<span class="lineNum">     792 </span>                : 
<span class="lineNum">     793 </span><span class="lineNoCov">              0 :           _Map_pointer __new_map = this-&gt;_M_allocate_map(__new_map_size);</span>
<span class="lineNum">     794 </span><span class="lineNoCov">              0 :           __new_nstart = __new_map + (__new_map_size - __new_num_nodes) / 2</span>
<span class="lineNum">     795 </span>                :                          + (__add_at_front ? __nodes_to_add : 0);
<span class="lineNum">     796 </span><span class="lineNoCov">              0 :           std::copy(this-&gt;_M_impl._M_start._M_node,</span>
<span class="lineNum">     797 </span>                :                     this-&gt;_M_impl._M_finish._M_node + 1,
<span class="lineNum">     798 </span>                :                     __new_nstart);
<span class="lineNum">     799 </span><span class="lineNoCov">              0 :           _M_deallocate_map(this-&gt;_M_impl._M_map, this-&gt;_M_impl._M_map_size);</span>
<span class="lineNum">     800 </span>                : 
<span class="lineNum">     801 </span><span class="lineNoCov">              0 :           this-&gt;_M_impl._M_map = __new_map;</span>
<span class="lineNum">     802 </span><span class="lineNoCov">              0 :           this-&gt;_M_impl._M_map_size = __new_map_size;</span>
<span class="lineNum">     803 </span>                :         }
<span class="lineNum">     804 </span>                : 
<span class="lineNum">     805 </span><span class="lineCov">          10568 :       this-&gt;_M_impl._M_start._M_set_node(__new_nstart);</span>
<span class="lineNum">     806 </span><span class="lineCov">          10568 :       this-&gt;_M_impl._M_finish._M_set_node(__new_nstart + __old_num_nodes - 1);</span>
<span class="lineNum">     807 </span><span class="lineCov">          10568 :     }</span>
<span class="lineNum">     808 </span>                : 
<span class="lineNum">     809 </span>                :   // Overload for deque::iterators, exploiting the &quot;segmented-iterator
<span class="lineNum">     810 </span>                :   // optimization&quot;.  NB: leave const_iterators alone!
<span class="lineNum">     811 </span>                :   template&lt;typename _Tp&gt;
<span class="lineNum">     812 </span>                :     void
<span class="lineNum">     813 </span>                :     fill(const _Deque_iterator&lt;_Tp, _Tp&amp;, _Tp*&gt;&amp; __first,
<span class="lineNum">     814 </span>                :          const _Deque_iterator&lt;_Tp, _Tp&amp;, _Tp*&gt;&amp; __last, const _Tp&amp; __value)
<span class="lineNum">     815 </span>                :     {
<span class="lineNum">     816 </span>                :       typedef typename _Deque_iterator&lt;_Tp, _Tp&amp;, _Tp*&gt;::_Self _Self;
<span class="lineNum">     817 </span>                : 
<span class="lineNum">     818 </span>                :       for (typename _Self::_Map_pointer __node = __first._M_node + 1;
<span class="lineNum">     819 </span>                :            __node &lt; __last._M_node; ++__node)
<span class="lineNum">     820 </span>                :         std::fill(*__node, *__node + _Self::_S_buffer_size(), __value);
<span class="lineNum">     821 </span>                : 
<span class="lineNum">     822 </span>                :       if (__first._M_node != __last._M_node)
<span class="lineNum">     823 </span>                :         {
<span class="lineNum">     824 </span>                :           std::fill(__first._M_cur, __first._M_last, __value);
<span class="lineNum">     825 </span>                :           std::fill(__last._M_first, __last._M_cur, __value);
<span class="lineNum">     826 </span>                :         }
<span class="lineNum">     827 </span>                :       else
<span class="lineNum">     828 </span>                :         std::fill(__first._M_cur, __last._M_cur, __value);
<span class="lineNum">     829 </span>                :     }
<span class="lineNum">     830 </span>                : 
<span class="lineNum">     831 </span>                : _GLIBCXX_END_NESTED_NAMESPACE
<span class="lineNum">     832 </span>                : 
<span class="lineNum">     833 </span>                : #endif
</pre>
      </td>
    </tr>
  </table>
  <br>

  <table width="100%" border=0 cellspacing=0 cellpadding=0>
  <tr><td class="ruler"><img src="../../../../../glass.png" width=3 height=3 alt=""></td></tr>
  <tr><td class="versionInfo">Generated by: <a href="http://ltp.sourceforge.net/coverage/lcov.php" target="_parent">LTP GCOV extension version 1.6</a></td></tr>
  </table>
  <br>

</body>
</html>
